<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateReservationSchedulesTable extends Migration
{
    /**
     * Run the migrations.
     * 预约挂号 预约计划
     * @return void
     */
    public function up()
    {
        Schema::create('st_reservation_schedules', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('doctor_id');
            $table->date('time')->index();
            $table->unsignedTinyInteger('room');
//            $table->unsignedTinyInteger('am');
            $table->text('workload')->nullable();
            $table->softDeletes();

            $table->index(['doctor_id', 'time']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('st_reservation_schedules');
    }
}
